# 绘图库
import matplotlib
import matplotlib.pyplot as plt
import numpy as np

print(matplotlib.__version__)



xpoints = np.array([0, 6])
ypoints = np.array([0, 100])

# 绘制二维图形线条
plt.title("二维图形")
plt.plot(xpoints, ypoints)
plt.show()

xpoints = np.array([1, 8])
ypoints = np.array([3, 10])


# 坐标点
plt.plot(xpoints, ypoints, 'o')
plt.show()

ypoints = np.array([1,3,4,5,8,9,6,1,3,4,5,2,4])

plt.plot(ypoints, marker = 'v')
plt.show()

ypoints = np.array([6, 2, 13, 10])

plt.plot(ypoints, 'o:r')
plt.show()

y = np.array([35, 25, 25, 15])

plt.pie(y)
plt.show()

y = np.array([35, 25, 25, 15])

plt.pie(y,
        labels=['A','B','C','D'], # 设置饼图标签
        colors=["#d5695d", "#5d8ca8", "#65a479", "#a564c9"], # 设置饼图颜色
        explode=(0, 0.2, 0, 0), # 第二部分突出显示，值越大，距离中心越远
        autopct='%.2f%%', # 格式化输出百分比
        )
plt.title("RUNOOB Pie Test")
plt.show()